#include <iostream>
#include "calpi.h"

int main(int argc, char *argv[]) {
	if (argc < 4) return -1;

	double start, end, ddx;
	int r;

	r = sscanf(argv[1], "%lf", &start);
	r += sscanf(argv[2], "%lf", &end);
	r += sscanf(argv[3], "%lf", &ddx);
	if (r < 3) return -2;

	ddx = 1.0 / ddx;

	printf("%.14f", calculate_range(start, end, ddx));

	return 0;
}
